﻿@model PagedList.IPagedList<ThesisSystem.Models.ThesisSearchView>
@{
    var thesisSearch = ViewBag.Current as ThesisSystem.ViewModels.ThesisSearch;
}
<!DOCTYPE html>
<html>
<head>
    <title>论文检索</title>
    <link href="../../Content/CSS/searchstyle.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="Search_thesis">
        <h3>论文检索</h3>
        @*查询条件*@
        <div class="sch_areas" align="center">
            @using (Html.BeginForm())
            {
                <div id="ThesisTitle" style="float: left; width: 43%; overflow: hidden; margin: 2px">
                    <span>论文标题：</span> @Html.TextBox("ThesisTitle", thesisSearch.ThesisTitle  as string)
                    </div>
                    <div id="studyProfessional" style="float: left; width: 38%; overflow: hidden; margin: 2px">
                        <span>专业：</span> @Html.TextBox("StudyProfessional", thesisSearch.StudyProfessional as string)
                    </div>
                    <br />
                    <div id="studentName" style="float: left; width: 47%; margin: 2px; clear: left">
                        <span>作者：</span>@Html.TextBox("Name", thesisSearch.Name as string)
                        </div>
                    <div id="studentID" style="float: left; width: 31%; overflow: hidden; margin: 2px">
                        <span>学号：</span> @Html.TextBox("StudentID", thesisSearch.StudentID  as string )
                    </div>
                    <div id="reviewStatus" style="float: left; width: 43%; overflow: hidden; margin: 2px;
                        clear: left">
                        <span>评审状态：</span> @Html.TextBox("ReviewStatus", thesisSearch.ReviewStatus as string)
                    </div>
                    <div id="thesisType" style="float: left; width: 46%; overflow: hidden; margin: 2px">
                        <span>论文类型：</span> @Html.DropDownList("ThesisType", string.Empty)
                    </div>
                    <div id="department" style="float: left; width: 45%; overflow: hidden; margin: 2px; clear: left">
                        <span>所在系：</span>@Html.TextBox("Department", thesisSearch.Department as string)
                        </div>
                    <p align="center" style="height: 28px; border: 1px solid #c3e1c9; margin: 2px; padding: 1px;
                        clear: left">
                        <input type="submit" value="检索" id="Searchbtn" />
                        <input type="reset" value="重置" id="Searchreset" />
                        <input type="button" onclick="javascript:window.history.go(-1);" value="返回上一页" id="Back" />
                    </p>

          }
                </div>  
    
@* 查询列表*@
                <div class="sch_area">
                    <table width="100%" class="lst_tbl" cellspacing="1px">
                        <tr>
                            <th align="center" class="crd_th" width="33%">
                                论文标题
                            </th>
                            <th align="center" class="crd_th" width="27%">
                                论文类型
                            </th>
                            <th align="center" class="crd_th" width="10%">
                                论文作者
                            </th>
                            <th align="center" class="crd_th" width="10%">
                                评审状态
                            </th>
                            <th align="center" class="crd_th" width="20%">
                                操作
                            </th>
                        </tr>
                        @foreach (var item in Model)
            {
                            <tr>
                                <td class="crd_td">
                                    @Html.DisplayFor(modelItem => item.ThesisTitle)
                                </td>
                                <td class="crd_td">
                                    @Html.DisplayFor(modelItem => item.ThesisType)
                                </td>
                                <td class="crd_td">
                                    @Html.DisplayFor(modelItem => item.Name)
                                </td>
                                <td class="crd_td">
                                    @Html.DisplayFor(modelItem => item.ReviewStatus)
                                </td>
                                <td class="crd_td">
                                    @Html.ActionLink("查看", "Tails", new { id = item.ThesisID }, new { id = "LockD1" })
                                    @Html.ActionLink("下载", "DownLoad", new { id = item.ThesisID }, new { id = "downLoad1" })
                                </td>
                            </tr>
            }
                    </table>
                </div>
                <div class="sch_area">
                    <p align="left" style="height: 30px; border: 1px solid #c3e1c9; margin: 1px; padding: 1px;
                        clear: left">
                        @*分页部分*@
                        @if (Model.PageCount > 1)
                {

                    if (Model.IsFirstPage)
                    {
                        ////当为第一页时，下一页为空链接
                            @:<a>首页</a> @Html.Encode("-")
                           @:<a>上一页</a>
                    }
                    else
                    {
                            @Html.ActionLink("首页", "Search", new { id = Request.QueryString["id"], page = 1, currentFilter = ViewBag.CurrentFilter })@Html.Encode("-")
                            @Html.ActionLink("上一页", "Search", new { id = Request.QueryString["id"], page = Model.PageIndex, currentFilter = ViewBag.CurrentFilter })
                    }
                             @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)  @:/ @(Model.PageCount)
                    if (Model.IsLastPage)
                    {
                        //当为最后一页时，下一页为空链接
                
                                    @:<a>下一页</a>@Html.Encode("-")
                       @:<a>尾页</a>
                    }
                    else
                    {

                //PageIndex为索引值，初始值为0，值为page-1。上一页为PageIndex,下一页为 PageIndex+2
                            @Html.ActionLink("下一页", "Search", new { id = Request.QueryString["id"], page = Model.PageIndex + 2, currentFilter = ViewBag.CurrentFilter }) @Html.Encode("-")
                
                            @Html.ActionLink("尾页", "Search", new { id = Request.QueryString["id"], page = Model.PageCount, currentFilter = ViewBag.CurrentFilter })
                      }
               }

            
                    </p>
                </div>

                @Content.Script("jquery-min.js", Url) 
                @Content.Script("jquery-ui-min.js", Url)
                <script type="text/javascript">
                    $(document).ready(function () {
                        $("#Searchbtn").button();
                        $("#Searchreset").button();
                        $("#Back").button();
                        $("#LockD").button();
                        $("#downLoad").button();
                    });
                </script>
                </div>
                </body>
            </html>
